# -*- coding: utf-8 -*-
__author__ = 'gerry'
import  random


real_num = random.randrange(10)


retry_count = 0
while retry_count<=3:

    guss_num = raw_input("Please guess the reall num:").strip()
    if len(guss_num)==0:
        print "Your input number is not right form!"
        continue
    if guss_num.isdigit():
        guss_num = int(guss_num)
    else:
        print "you should input a number!"
        continue

    retry_count+=1
    if guss_num>real_num:
        print"Wrong! you need try smaller!"
    elif guss_num<real_num:
        print"Wrong! you need try bigger!"
    else:
        print("Congratulations! you got it")
        break
else:
    print "The real num is:",real_num





































